package samoloty.data;

import java.util.ArrayList;
import samoloty.model.IDataModel;
import samoloty.model.models.AcRegModel;
import samoloty.model.models.ConfigurationModel;
import samoloty.model.models.ConstModel;
import samoloty.model.models.CrewModel;
import samoloty.model.models.FuelModel;
import samoloty.model.models.HoldsModel;
import samoloty.model.models.IdealTrimModel;
import samoloty.model.models.LimitLawModel;
import samoloty.model.models.LimitTowModel;
import samoloty.model.models.LimitTowffModel;
import samoloty.model.models.LimitZfwModel;
import samoloty.model.models.LimitZfwffModel;
import samoloty.model.models.MaxWeightsModel;
import samoloty.model.models.PantryModel;
import samoloty.model.models.PaxModel;
import samoloty.model.models.StabTrimModel;
import samoloty.model.models.StabTrimSubModel;
import samoloty.model.models.StabTrimSubSubModel;

public class DataBase3 extends CommonDataBase implements IDataModel {

    public DataBase3() {
        super();
        initData();
    }

    public ArrayList<String> getAcReg() {
        return acRegData;
    }

    public ArrayList<ConfigurationModel> getConfiguration() {
        return configuration;
    }

    public ConstModel getConst() {
        return constData;
    }

    public ArrayList<CrewModel> getCrew() {
        return crewData;
    }

    public ArrayList<FuelModel> getFuel() {
        return fuelData;
    }

    public ArrayList<HoldsModel> getHolds() {
        return holdsData;
    }

    public ArrayList<LimitLawModel> getLimitLaw() {
        return limitLawData;
    }

    public ArrayList<LimitTowModel> getLimitTow() {
        return limitTowData;
    }

    public ArrayList<LimitTowffModel> getLimitTowff() {
        return limitTowffData;
    }

    public ArrayList<LimitZfwModel> getLimitZfw() {
        return limitZfwData;
    }

    public ArrayList<LimitZfwffModel> getLimitZfwff() {
        return limitZfwffData;
    }

    public MaxWeightsModel getMaxWeights() {
        return maxWeightsData;
    }

    public PantryModel getPantry() {
        return pantryData;
    }

    public ArrayList<PaxModel> getPax() {
        return paxData;
    }

    public StabTrimModel getStabTrimFlap1() {
        return stabTrimFlap1Data;
    }

    public StabTrimModel getStabTrimFlap2() {
        return stabTrimFlap2Data;
    }

    public StabTrimModel getStabTrimFlap3() {
        return stabTrimFlap3Data;
    }

    public StabTrimModel getStabTrimFlap4() {
        return stabTrimFlap4Data;
    }

    public ArrayList<IdealTrimModel> getIdealTrim() {
        return idealTrimData;
    }

    private void initData() {
        initAcReg();
        initConst();
        initCrew();
        initConfiguratin();
        initFuel();
        initHolds();
        initLimitLaw();
        initLimitTow();
        initLimitTowff();
        initLimitZfw();
        initLimitZfwff();
        initPantry();
        initPax();
        initMaxWeights();
        initStabTrimFlap1();
        initStabTrimFlap2();
        initStabTrimFlap3();
        initIdealTrim();
    }

    private void initAcReg() {
        acRegData = new ArrayList<String>();
        acRegData.add(new String("SP-LDA"));
        acRegData.add(new String("SP-LDB"));
        acRegData.add(new String("SP-LDC"));
        acRegData.add(new String("SP-LDD"));
        acRegData.add(new String("SP-LDE"));
        acRegData.add(new String("SP-LDF"));
        acRegData.add(new String("SP-LDG"));
        acRegData.add(new String("SP-LDH"));
        acRegData.add(new String("SP-LDI"));
        acRegData.add(new String("SP-LDK"));

    }

    private void initConst() {
        constData = new ConstModel(400, 70, 13.8, 12.925, 3.194);
    }

    private void initCrew() {
        crewData = new ArrayList<CrewModel>();
        crewData.add(new CrewModel("2/2", 2, 2, 320, -4.82260));
        crewData.add(new CrewModel("2/0", 2, 0, 170, -4.67080));
        crewData.add(new CrewModel("3/2", 3, 2, 405, -7.01140));
        crewData.add(new CrewModel("3/0", 3, 0, 255, -6.85950));

    }

    private void initConfiguratin() {
        configuration = new ArrayList<ConfigurationModel>();
        configuration.add(new ConfigurationModel("Y70", 0, 70, 0, 22, 0, 24, 0, 24));
        configuration.add(new ConfigurationModel("C6Y64", 6, 64, 6, 16, 0, 24, 0, 24));
        configuration.add(new ConfigurationModel("C10Y60", 10, 60, 10, 12, 0, 24, 0, 24));
        configuration.add(new ConfigurationModel("C14Y56", 14, 56, 14, 8, 0, 24, 0, 24));
        configuration.add(new ConfigurationModel("C18Y52", 18, 52, 18, 4, 0, 24, 0, 24));
        configuration.add(new ConfigurationModel("C22Y48", 22, 48, 22, 0, 0, 24, 0, 24));
        configuration.add(new ConfigurationModel("C26Y44", 26, 44, 22, 0, 4, 20, 0, 24));
        configuration.add(new ConfigurationModel("C30Y40", 30, 40, 22, 0, 8, 16, 0, 24));
        configuration.add(new ConfigurationModel("C34Y36", 34, 36, 22, 0, 12, 12, 0, 24));
        configuration.add(new ConfigurationModel("C38Y32", 38, 32, 22, 0, 16, 8, 0, 24));
        configuration.add(new ConfigurationModel("C42Y28", 42, 28, 22, 0, 20, 4, 0, 24));
        configuration.add(new ConfigurationModel("C46Y24", 46, 24, 22, 0, 24, 0, 0, 24));
        configuration.add(new ConfigurationModel("C50Y20", 50, 20, 22, 0, 24, 0, 4, 20));
        configuration.add(new ConfigurationModel("C54Y16", 54, 16, 22, 0, 24, 0, 8, 16));
        configuration.add(new ConfigurationModel("C58Y12", 58, 12, 22, 0, 24, 0, 12, 12));
        configuration.add(new ConfigurationModel("C62Y8", 62, 8, 22, 0, 24, 0, 16, 8));
        configuration.add(new ConfigurationModel("C66Y4", 66, 4, 22, 0, 24, 0, 20, 4));
        configuration.add(new ConfigurationModel("C70", 70, 0, 22, 0, 24, 0, 24, 0));
        configuration.add(new ConfigurationModel("Y69", 0, 69, 0, 22, 0, 24, 0, 23));
        configuration.add(new ConfigurationModel("C6Y63", 6, 63, 6, 16, 0, 24, 0, 23));
        configuration.add(new ConfigurationModel("C10Y59", 10, 59, 10, 12, 0, 24, 0, 23));
        configuration.add(new ConfigurationModel("C14Y55", 14, 55, 14, 8, 0, 24, 0, 23));
        configuration.add(new ConfigurationModel("C18Y51", 18, 51, 18, 4, 0, 24, 0, 23));
        configuration.add(new ConfigurationModel("C22Y47", 22, 47, 22, 0, 0, 24, 0, 23));
        configuration.add(new ConfigurationModel("C26Y43", 26, 43, 22, 0, 4, 20, 0, 23));
        configuration.add(new ConfigurationModel("C30Y39", 30, 39, 22, 0, 8, 16, 0, 23));
        configuration.add(new ConfigurationModel("C34Y35", 34, 35, 22, 0, 12, 12, 0, 23));
        configuration.add(new ConfigurationModel("C38Y31", 38, 31, 22, 0, 16, 8, 0, 23));
        configuration.add(new ConfigurationModel("C42Y27", 42, 27, 22, 0, 20, 4, 0, 23));
        configuration.add(new ConfigurationModel("C46Y23", 46, 23, 22, 0, 24, 0, 0, 23));
        configuration.add(new ConfigurationModel("C50Y19", 50, 19, 22, 0, 24, 0, 4, 19));
        configuration.add(new ConfigurationModel("C54Y15", 54, 15, 22, 0, 24, 0, 8, 15));
        configuration.add(new ConfigurationModel("C58Y11", 58, 11, 22, 0, 24, 0, 12, 11));
        configuration.add(new ConfigurationModel("C62Y7", 62, 7, 22, 0, 24, 0, 16, 7));
        configuration.add(new ConfigurationModel("C66Y3", 66, 3, 22, 0, 24, 0, 20, 3));
        configuration.add(new ConfigurationModel("C69", 69, 0, 22, 0, 24, 0, 23, 0));

    }

    private void initFuel() {
        fuelData = new ArrayList<FuelModel>();
        fuelData.add(new FuelModel(0, 0.0));
        fuelData.add(new FuelModel(500, -1.3));
        fuelData.add(new FuelModel(1000, -2.4));
        fuelData.add(new FuelModel(1500, -3.7));
        fuelData.add(new FuelModel(2000, -4.9));
        fuelData.add(new FuelModel(2500, -6.0));
        fuelData.add(new FuelModel(3000, -7.1));
        fuelData.add(new FuelModel(3500, -8.1));
        fuelData.add(new FuelModel(4000, -9.1));
        fuelData.add(new FuelModel(4500, -10.1));
        fuelData.add(new FuelModel(5000, -11.1));
        fuelData.add(new FuelModel(5500, -12.0));
        fuelData.add(new FuelModel(6000, -12.8));
        fuelData.add(new FuelModel(6500, -13.6));
        fuelData.add(new FuelModel(6800, -14.0));
        fuelData.add(new FuelModel(6900, -14.1));
        fuelData.add(new FuelModel(7100, -14.2));
        fuelData.add(new FuelModel(7300, -14.3));
        fuelData.add(new FuelModel(7620, -14.3));
        fuelData.add(new FuelModel(7780, -14.2));
        fuelData.add(new FuelModel(7950, -14.1));
        fuelData.add(new FuelModel(8100, -13.9));
        fuelData.add(new FuelModel(8270, -13.7));
        fuelData.add(new FuelModel(8430, -13.4));
        fuelData.add(new FuelModel(8600, -13.1));
        fuelData.add(new FuelModel(8760, -12.7));
        fuelData.add(new FuelModel(8920, -12.3));
        fuelData.add(new FuelModel(9080, -11.8));
        fuelData.add(new FuelModel(9250, -11.2));
        fuelData.add(new FuelModel(9470, -10.3));

    }

    private void initHolds() {
        holdsData = new ArrayList<HoldsModel>();
        holdsData.add(new HoldsModel("1", 457, -0.02028));
        holdsData.add(new HoldsModel("2", 913, -0.01350));
        holdsData.add(new HoldsModel("3", 686, 0.01133));
        holdsData.add(new HoldsModel("4", 344, 0.01688));

    }

    private void initLimitZfw() {
        limitZfwData = new ArrayList<LimitZfwModel>();
        limitZfwData.add(new LimitZfwModel(21800, 55.0, 21800, 55.0));
        limitZfwData.add(new LimitZfwModel(22770, 41.2, 23000, 59.7));
        limitZfwData.add(new LimitZfwModel(26510, 34.5, 29600, 59.3));
        limitZfwData.add(new LimitZfwModel(29600, 37.5, 29600, 59.3));

    }

    private void initLimitTow() {
        limitTowData = new ArrayList<LimitTowModel>();
        limitTowData.add(new LimitTowModel(21800, 55.0, 21800, 55.0));
        limitTowData.add(new LimitTowModel(23000, 37.7, 23000, 54.3));
        limitTowData.add(new LimitTowModel(34500, 19.1, 29600, 59.3));
        limitTowData.add(new LimitTowModel(35990, 24.1, 35990, 59.1));

    }

    private void initLimitLaw() {
        limitLawData = new ArrayList<LimitLawModel>();
        limitLawData.add(new LimitLawModel(21800, 55.0, 21800, 55.0));
        limitLawData.add(new LimitLawModel(23000, 37.7, 23000, 54.3));
        limitLawData.add(new LimitLawModel(34500, 19.1, 29600, 59.3));
        limitLawData.add(new LimitLawModel(35990, 24.1, 35990, 59.1));

    }

    private void initLimitZfwff() {
        limitZfwffData = new ArrayList<LimitZfwffModel>();
        limitZfwffData.add(new LimitZfwffModel(21800, 54.7, 21800, 55.0));
        limitZfwffData.add(new LimitZfwffModel(22800, 36.5, 23000, 69.0));
        limitZfwffData.add(new LimitZfwffModel(26700, 30.0, 29600, 68.8));
        limitZfwffData.add(new LimitZfwffModel(29600, 32.5, 29600, 68.8));

    }

    private void initLimitTowff() {
        limitTowffData = new ArrayList<LimitTowffModel>();
        limitTowffData.add(new LimitTowffModel(21800, 54.7, 21800, 55));
        limitTowffData.add(new LimitTowffModel(23000, 32.9, 23000, 56.4));
        limitTowffData.add(new LimitTowffModel(34500, 14.2, 29600, 68.8));
        limitTowffData.add(new LimitTowffModel(35990, 19.2, 35990, 68.6));

    }

    private void initPantry() {
        pantryData = new PantryModel(444, -0.02252, 0.00000, 0.00000, 353, 0.02203);

    }

    private void initPax() {
        paxData = new ArrayList<PaxModel>();
        paxData.add(new PaxModel("0A", -0.01153));
        paxData.add(new PaxModel("0B", 0.00020));
        paxData.add(new PaxModel("0C", 0.01239));

    }

    private void initMaxWeights() {
        maxWeightsData = new MaxWeightsModel(36150, 35990, 29600, 32800);
    }

    private void initStabTrimFlap1() {
        ArrayList<StabTrimSubModel> stabTrimSub = new ArrayList<StabTrimSubModel>();
        ArrayList<StabTrimSubSubModel> stabMacs1 = new ArrayList<StabTrimSubSubModel>();
        stabMacs1.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs1.add(new StabTrimSubSubModel(9, -6.0));
        stabMacs1.add(new StabTrimSubSubModel(11, -5.5));
        stabMacs1.add(new StabTrimSubSubModel(13, -5.0));
        stabMacs1.add(new StabTrimSubSubModel(15, -5.0));
        stabMacs1.add(new StabTrimSubSubModel(17, -4.5));
        stabMacs1.add(new StabTrimSubSubModel(19, -4.0));
        stabMacs1.add(new StabTrimSubSubModel(21, -3.5));
        stabMacs1.add(new StabTrimSubSubModel(23, -3.0));
        stabMacs1.add(new StabTrimSubSubModel(25, -3.0));
        stabMacs1.add(new StabTrimSubSubModel(27, -2.5));
        ArrayList<StabTrimSubSubModel> stabMacs2 = new ArrayList<StabTrimSubSubModel>();
        stabMacs2.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs2.add(new StabTrimSubSubModel(9, -6.0));
        stabMacs2.add(new StabTrimSubSubModel(11, -5.5));
        stabMacs2.add(new StabTrimSubSubModel(13, -5.0));
        stabMacs2.add(new StabTrimSubSubModel(15, -5.0));
        stabMacs2.add(new StabTrimSubSubModel(17, -4.5));
        stabMacs2.add(new StabTrimSubSubModel(19, -4.0));
        stabMacs2.add(new StabTrimSubSubModel(21, -3.5));
        stabMacs2.add(new StabTrimSubSubModel(23, -3.0));
        stabMacs2.add(new StabTrimSubSubModel(25, -3.0));
        stabMacs2.add(new StabTrimSubSubModel(27, -2.5));
        stabTrimSub.add(new StabTrimSubModel("FLAP 1", 21800, stabMacs1));
        stabTrimSub.add(new StabTrimSubModel("", 35990, stabMacs2));
        stabTrimFlap1Data = new StabTrimModel(stabTrimSub);
    }

    private void initStabTrimFlap2() {
        ArrayList<StabTrimSubModel> stabTrimSub = new ArrayList<StabTrimSubModel>();
        ArrayList<StabTrimSubSubModel> stabMacs1 = new ArrayList<StabTrimSubSubModel>();
        stabMacs1.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs1.add(new StabTrimSubSubModel(9, -6.0));
        stabMacs1.add(new StabTrimSubSubModel(11, -5.5));
        stabMacs1.add(new StabTrimSubSubModel(13, -5.0));
        stabMacs1.add(new StabTrimSubSubModel(15, -4.5));
        stabMacs1.add(new StabTrimSubSubModel(17, -4.0));
        stabMacs1.add(new StabTrimSubSubModel(19, -3.5));
        stabMacs1.add(new StabTrimSubSubModel(21, -3.5));
        stabMacs1.add(new StabTrimSubSubModel(23, -3.0));
        stabMacs1.add(new StabTrimSubSubModel(25, -2.5));
        stabMacs1.add(new StabTrimSubSubModel(27, -2.0));
        ArrayList<StabTrimSubSubModel> stabMacs2 = new ArrayList<StabTrimSubSubModel>();
        stabMacs2.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs2.add(new StabTrimSubSubModel(9, -6.0));
        stabMacs2.add(new StabTrimSubSubModel(11, -5.5));
        stabMacs2.add(new StabTrimSubSubModel(13, -5.0));
        stabMacs2.add(new StabTrimSubSubModel(15, -4.5));
        stabMacs2.add(new StabTrimSubSubModel(17, -4.0));
        stabMacs2.add(new StabTrimSubSubModel(19, -3.5));
        stabMacs2.add(new StabTrimSubSubModel(21, -3.5));
        stabMacs2.add(new StabTrimSubSubModel(23, -3.0));
        stabMacs2.add(new StabTrimSubSubModel(25, -2.5));
        stabMacs2.add(new StabTrimSubSubModel(27, -2.0));
        stabTrimSub.add(new StabTrimSubModel("FLAP 2", 21800, stabMacs1));
        stabTrimSub.add(new StabTrimSubModel("", 35990, stabMacs2));
        stabTrimFlap2Data = new StabTrimModel(stabTrimSub);
    }

    private void initStabTrimFlap3() {
        ArrayList<StabTrimSubModel> stabTrimSub = new ArrayList<StabTrimSubModel>();
        ArrayList<StabTrimSubSubModel> stabMacs1 = new ArrayList<StabTrimSubSubModel>();
        stabMacs1.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs1.add(new StabTrimSubSubModel(9, -5.5));
        stabMacs1.add(new StabTrimSubSubModel(11, -5.0));
        stabMacs1.add(new StabTrimSubSubModel(13, -4.5));
        stabMacs1.add(new StabTrimSubSubModel(15, -4.0));
        stabMacs1.add(new StabTrimSubSubModel(17, -3.5));
        stabMacs1.add(new StabTrimSubSubModel(19, -3.0));
        stabMacs1.add(new StabTrimSubSubModel(21, -2.5));
        stabMacs1.add(new StabTrimSubSubModel(23, -2.0));
        stabMacs1.add(new StabTrimSubSubModel(25, -1.5));
        stabMacs1.add(new StabTrimSubSubModel(27, -1.0));
        ArrayList<StabTrimSubSubModel> stabMacs2 = new ArrayList<StabTrimSubSubModel>();
        stabMacs2.add(new StabTrimSubSubModel(7, -6.0));
        stabMacs2.add(new StabTrimSubSubModel(9, -5.5));
        stabMacs2.add(new StabTrimSubSubModel(11, -5.0));
        stabMacs2.add(new StabTrimSubSubModel(13, -4.5));
        stabMacs2.add(new StabTrimSubSubModel(15, -4.0));
        stabMacs2.add(new StabTrimSubSubModel(17, -3.5));
        stabMacs2.add(new StabTrimSubSubModel(19, -3.0));
        stabMacs2.add(new StabTrimSubSubModel(21, -2.5));
        stabMacs2.add(new StabTrimSubSubModel(23, -2.0));
        stabMacs2.add(new StabTrimSubSubModel(25, -1.5));
        stabMacs2.add(new StabTrimSubSubModel(27, -1.0));
        stabTrimSub.add(new StabTrimSubModel("FLAP 4", 21800, stabMacs1));
        stabTrimSub.add(new StabTrimSubModel("", 35990, stabMacs2));
        stabTrimFlap3Data = new StabTrimModel(stabTrimSub);
    }

    private void initIdealTrim() {
        idealTrimData = new ArrayList<IdealTrimModel>();
        idealTrimData.add(new IdealTrimModel(21800, 55));
        idealTrimData.add(new IdealTrimModel(29600, 58));

    }

    public String getLabel() {
        return "ERJ 170-100";
    }
    private ArrayList<String> acRegData;
    private ConstModel constData;
    private ArrayList<CrewModel> crewData;
    private ArrayList<ConfigurationModel> configuration;
    private ArrayList<FuelModel> fuelData;
    private ArrayList<HoldsModel> holdsData;
    private ArrayList<LimitZfwModel> limitZfwData;
    private ArrayList<LimitTowModel> limitTowData;
    private ArrayList<LimitLawModel> limitLawData;
    private ArrayList<LimitZfwffModel> limitZfwffData;
    private ArrayList<LimitTowffModel> limitTowffData;
    private PantryModel pantryData;
    private ArrayList<PaxModel> paxData;
    private MaxWeightsModel maxWeightsData;
    private StabTrimModel stabTrimFlap1Data;
    private StabTrimModel stabTrimFlap2Data;
    private StabTrimModel stabTrimFlap3Data;
    private StabTrimModel stabTrimFlap4Data;
    private ArrayList<IdealTrimModel> idealTrimData;
}
